home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Emulators / v2600 / Source.lha / Source / vmachine.h < prev   
Encoding:
C/C++ Source or Header  |  1997-04-24  |  2.9 KB  |  129 lines

  1. /*****************************************************************************
  2.  
  3.    This file is part of x2600, the Atari 2600 Emulator
  4.    ===================================================
  5.    
  6.    Copyright 1996 Alex Hornby. For contributions see the file CREDITS.
  7.  
  8.    This software is distributed under the terms of the GNU General Public
  9.    License. This is free software with ABSOLUTELY NO WARRANTY.
  10.    
  11.    See the file COPYING for details.
  12.    
  13.    $Id: vmachine.h,v 2.13 1996/11/24 16:55:40 ahornby Exp $
  14.  
  15.    Tweaked by Matthew Stroup for Amiga v2600, January 27, 1997.
  16.  
  17. ******************************************************************************/
  18.  
  19.  
  20. /*
  21.    External definitions of the 2600 virtual machine.
  22. */
  23.  
  24.  
  25. #ifndef VMACHINE_H
  26. #define VMACHINE_H
  27.  
  28. extern int rom_size;
  29. extern UBYTE theCart[16384];
  30. extern UBYTE *theRom;
  31. extern UBYTE cartScratch[4096];
  32. extern UBYTE cartRam[1024];
  33. extern UBYTE theRam[128];
  34. extern UBYTE riotRead[0x298];
  35. extern UBYTE riotWrite[0x298];
  36. extern UBYTE tiaWrite[0x2d];
  37. extern UBYTE tiaRead[0x0e];
  38. extern UBYTE keypad[2][4];
  39.  
  40. extern int reset_flag;
  41.  
  42. extern int ebeamx, ebeamy, sbeamx;
  43.  
  44. #define VSYNCSTATE 1
  45. #define VBLANKSTATE 2
  46. #define HSYNCSTATE 4
  47. #define DRAWSTATE 8
  48. #define OVERSTATE 16 
  49.  
  50. extern int vbeam_state, hbeam_state;
  51.  
  52. extern int tv_width, tv_height, tv_vsync, tv_vblank,
  53.     tv_overscan, tv_frame, tv_hertz, tv_hsync;
  54.  
  55. extern int timer_res, timer_count, timer_clks; 
  56.  
  57. extern struct PlayField {
  58.     UBYTE pf0,pf1,pf2;
  59.     UBYTE ref;
  60. } pf[2];  
  61.  
  62. extern struct Paddle {
  63.     int pos;
  64.     int val;
  65. } paddle[4];
  66.  
  67. extern struct Player {
  68.   int x;
  69.   UBYTE grp;
  70.   UBYTE hmm;
  71.   UBYTE vdel;
  72.   UBYTE vdel_flag;
  73.   UBYTE nusize;
  74.   UBYTE reflect;
  75.   UBYTE mask;
  76. } pl[2];
  77.  
  78. struct RasterChange {
  79.   int x;     /* Position at which change happened */
  80.   int type;  /* Type of change */
  81.   int val;   /* Value of change */
  82. } ;
  83.  
  84. extern struct RasterChange pl_change[2][80], pf_change[1][80], unified[80];
  85.  
  86. extern int pl_change_count[2], pf_change_count[1], unified_count;
  87.  
  88. /* The missile and ball positions */
  89. extern struct Missile {
  90.     int x;
  91.     UBYTE hmm;
  92.     UBYTE locked;
  93.     UBYTE enabled;
  94.     UBYTE width;
  95.     UBYTE vdel;
  96.     UBYTE vdel_flag;
  97.     UBYTE mask;
  98. } ml[3];
  99.  
  100. /****************************************************************************
  101.                               functions.
  102. *****************************************************************************/
  103.  
  104. void do_plraster_change(int i, int type, int val);
  105.  
  106. void do_unified_change(int type, int val);
  107.  
  108. void use_unified_change( struct RasterChange *rc);
  109.  
  110. void use_plraster_change( struct Player *pl, struct RasterChange *rc);
  111.  
  112. void do_pfraster_change(int i, int type, int val);
  113.  
  114. void use_pfraster_change( struct PlayField *pf, struct RasterChange *rc);
  115.  
  116. void init_hardware(void);
  117. void init_banking(void);
  118.  
  119. void set_timer(int res, int count, int clkadj);
  120. UBYTE do_timer(int clkadj);
  121. void do_vblank(UBYTE b);
  122. void do_hsync(void);
  123.  
  124. int  do_paddle(int padnum);
  125. UBYTE do_keypad(int pad, int col);
  126. void do_screen(int clks);
  127.  
  128. #endif
  129.